<template>
	<view class="goodList">

		<view v-for="(item, index) in list" :key="index" class="goods">
			<view v-if="item.type==1" class="top" @tap="jumpDetails(item)">
				<image class="cover" lazy-load="true" v-if="item.skuItem.picUrl" :src="item.skuItem.picUrl" mode="scaleToFill"></image>
			</view>
			<view v-if="item.type==1" class="bottom padding-lr-sm"  >
				<view v-if="item.skuItem.skuSubTitle" class="text-xs good_skuSubTitle" style="color: #009125;">
					{{item.skuItem.skuSubTitle.text}}
				</view>
				<view class="goods_name text-df">
					{{item.skuItem.skuTitle.text}}
				</view>
				<view v-if="item.skuItem.recReason" class="text-sm good_skuSubTitle padding-bottom-xs" style="color: #D5A94D;">
					{{item.skuItem.recReason.recReasonText.text}}
				</view>
				<view>
					<text class="tag1" v-if="item.skuItem.v2Tags&&item.skuItem.v2Tags[0].styleText&&item.skuItem.v2Tags[0].tagType==0">
						{{item.skuItem.v2Tags[0].styleText.text}}
					</text>
					<view class="" style="width: 82rpx; height: 30rpx;" v-else-if="item.skuItem.v2Tags&&item.skuItem.v2Tags[0].image&&item.skuItem.v2Tags[0].tagType==1">
						<image  :src="item.skuItem.v2Tags[0].image.url" class="w-100 h-100" mode="aspectFit"></image>
					</view>
				</view>
				<view class="goumai margin-top-xs flex justify-between align-center">
					<view class="g_left price">
						<text v-if="item.skuItem.sellPrice" class="text1  text-bold text-sm"> {{item.skuItem.sellPrice.text}}</text>
						<text v-if="item.skuItem.dashPrice" class="text2 text-xs"> {{item.skuItem.dashPrice.text}}</text>

					</view>
					<view class="g_right" @tap="addCart(item)">
						<image src="/static/images/new/jiagou.png" style=" width: 28px;height: 28px;" mode="aspectFill"></image>
					</view>
				</view>
			</view>

			<view v-if="item.type==4" class="cboardVO padding-xs"  :style="{backgroundImage:'url('+item.cboardVO.cboardBackGroundPic.url+')'}">
				<view class="padding-left-sm w-100" style="height: 20%;">
					<image :src="item.cboardVO.cboardNamePic.url" style="width: 75%;height:50%;"  mode="aspectFit"></image>
					<view class="text-white text-sm" style="height: 40%;">{{item.cboardVO.cboardDesc.text}}</view>
				</view>
				<view class="bg-white w-100 flex flex-direction justify-around padding-sm "  style="height: 80%;border-radius: 4%;" >
					<view class="flex" style="height: 30%;position: relative;" v-for="(good_item ,index) in item.cboardVO.cboardTabVO.skuItems">
						<view class="h-100" style="width: 50%;">
							<image :src="good_item.picUrl" style="width: 100%;" class="h-100" mode="aspectFit"></image>
							<image :src="'/static/images/new/tag'+index+'.png'" class="cboardVO_tag" mode="aspectFit"></image>
						</view>
						<view class="h-100 flex flex-wrap flex-direction justify-center" style="width: 50%;"> 
							<view class="w-100 priceColor">{{good_item.sellPrice.text}}</view>
							<view class="w-100 text-gray text-sm padding-top-xs">日售{{good_item.dailySales}}</view>
						</view>
					</view>
				</view>
				
			</view>

		</view>
		<view class="place">
		</view>
	</view>
</template>

<script>
	import {getCart, setCart ,resetCart, getCartNumber,setGoodsData, setGoodsDetails,getToken} from '@/utils/auth.js'
	export default {
		data() {
			return {
				good_data:{
					number: 1,
					imgList:[],
					selectSku:{},
					sku: [{
						sku_id: 1,
						skuname: '规格',
						child: [{
								tagname: '测试规格1',
								id: 2011,
								imgs: '',
								money: ''
							},
							{
								tagname: '测试规格2',
								id: 2012,
								imgs: '',
								money: ''
							}
						]
					}],
					skuArr: [{
							goods_sku_arr: ['2011'],
							goods_sku_text: '醇黑巧克力【20枚】',
							img: 'http://img10.360buyimg.com/n1/jfs/t1/86401/35/12206/357766/5e43b59cE5a7aa4dd/0753be765166c195.jpg',
							money: '175.78',
							stock: 345
						},
						{
							goods_sku_arr: ['2012'],
							goods_sku_text: '草莓味【8枚】',
							img: 'http://img11.360buyimg.com/n1/jfs/t1/74434/3/6892/331750/5d512febE54e891c4/0096ad20c3c20d23.jpg',
							money: '35.90',
							stock: 255
						},
					]
				},
				list: [
					
					{
						"type": 1,
						"skuItem": 
						{
							"subscription": false,
							"subStatus": false,
							"skuId": 66974,
							"picUrl": "https://p1.meituan.net/mallimages/079490467a182c4b8fb388443e148cb088500.jpg",
							"skuTitle": {
								"text": "乳山生蚝75g-100g"
							},
							"skuSubTitle": {
								"text": "乳山优质产地，三倍体生蚝更甜美，肉质肥嫩，建议烹饪后食用",
								"styleId": "lstv570"
							},
							"sellUnit": {
								"text": "个"
							},
							"sellPrice": {
								"text": "¥2.5"
							},
							"dashPrice": {
								"text": "¥3.99",
								"styleId": "dp"
							},
							"sellButton": {
								"text": "",
								"enable": true,
								"status": 1
							},
							"loose": false,
							"buyStep": "1",
							"buyUnit": "个",
							"process": false,
							"similar": false,
							"seqPrice": 250,
							"v2Tags": [{
									"tagType": 0,
									"type": 2,
									"priority": 10,
									"ordered": 15,
									"styleText": {
										"text": "6.3折",
										"styleId": "tag_new_pro"
									}
								},
								{
									"tagType": 2,
									"type": 7,
									"priority": 35,
									"ordered": 25,
									"image": {
										"title": "",
										"url": "https://p0.meituan.net/mallimages/6c17858c3ce19fe909ad4ad6c2c62b2112570.png",
										"width": 48,
										"height": 44,
										"imageId": ""
									},
									"styleText": {
										"text": "应季好货",
										"styleId": "tag_base_property"
									}
								},
								{
									"tagType": 2,
									"type": 9,
									"priority": 45,
									"ordered": 35,
									"image": {
										"title": "",
										"url": "https://p1.meituan.net/mallimages/f8dc4fe80401dbf8855a3dcdbf15ede15100.png",
										"width": 30,
										"height": 16,
										"imageId": ""
									},
									"styleText": {
										"text": "活鲜",
										"styleId": "tag_temperature"
									}
								}
							],
							"buttonList": [{
								"text": "",
								"enable": true,
								"status": 1
							}],
							"choiceEnable": false,
							"detailPagePic": "https://p1.meituan.net/mallimages/745afea961b998736b387863d9855be9210296.jpg",
							"categoryId": 0,
							"baseCategoryId": 14
						}
					},
					{
						"type": 4,
						"cboardVO": {
							"boardType": 1,
							"cboardNamePic": {
								"title": "",
								"url": "https://p1.meituan.net/mallimages/94410babb2522ef1bd1eb918d2af5bb713795.png",
								"width": 504,
								"height": 75
							},
							"cboardBackGroundPic": {
								"title": "",
								"url": "https://p0.meituan.net/mallimages/f53dfa85384b47167e5415ed9a048ccf43232.png",
								"width": 344,
								"height": 500
							},
							"cboardDesc": {
								"text": "分分钟卖断货"
							},
							"cboardName": {
								"text": "24小时热卖榜"
							},
							"cboardTabVO": {
								"skuItems": [
									{
										"subscription": false,
										"subStatus": false,
										"skuId": 95074,
										"picUrl": "https://p1.meituan.net/mallimages/c0f34d20d22862f1f8eb86f5065b5b78124431.jpg",
										"skuTitle": {
											"text": "爆汁番茄约500g"
										},
										"skuSubTitle": {
											"text": "红扑扑的脸蛋，讨人欢喜",
											"styleId": "lstv570"
										},
										"sellUnit": {
											"text": "份"
										},
										"sellPrice": {
											"text": "¥4.39"
										},
										"dashPrice": {
											"text": "¥5.29",
											"styleId": "dp"
										},
										"sellButton": {
											"text": "",
											"enable": true,
											"status": 1
										},
										"loose": false,
										"buyStep": "1",
										"buyUnit": "份",
										"process": false,
										"similar": false,
										"seqPrice": 439,
										"v2Tags": [{
											"tagType": 1,
											"type": 2,
											"priority": 10,
											"ordered": 15,
											"image": {
												"title": "",
												"url": "https://p0.meituan.net/mallimages/ba73de9ddd06ac5c57406f846340538a7317.png",
												"width": 40,
												"height": 14,
												"imageId": ""
											}
										}],
										"dailySales": 866,
										"buttonList": [{
											"text": "",
											"enable": true,
											"status": 1
										}],
										"choiceEnable": false,
										"boardChosenReasons": [{
											"text": "日售866"
										}],
										"detailPagePic": "https://p0.meituan.net/mallimages/ee3805fbed3f8602938803630209c1bb208610.jpg",
										"categoryId": 0,
										"baseCategoryId": 226
									},
									{
										"subscription": false,
										"subStatus": false,
										"skuId": 99020,
										"picUrl": "https://p0.meituan.net/mallimages/2096c6ac90f45e925f7167fc95cfb86742720.jpg",
										"skuTitle": {
											"text": "广西砂糖桔500g起"
										},
										"skuSubTitle": {
											"text": "香甜多汁，味香馥郁",
											"styleId": "lstv570"
										},
										"sellUnit": {
											"text": "盒"
										},
										"sellPrice": {
											"text": "¥3.99"
										},
										"dashPrice": {
											"text": "¥7.9",
											"styleId": "dp"
										},
										"sellButton": {
											"text": "",
											"enable": true,
											"status": 1
										},
										"loose": false,
										"buyStep": "1",
										"buyUnit": "盒",
										"process": false,
										"similar": false,
										"seqPrice": 399,
										"v2Tags": [{
											"tagType": 1,
											"type": 2,
											"priority": 10,
											"ordered": 15,
											"image": {
												"title": "",
												"url": "https://p0.meituan.net/mallimages/ba73de9ddd06ac5c57406f846340538a7317.png",
												"width": 40,
												"height": 14,
												"imageId": ""
											}
										}],
										"dailySales": 759,
										"buttonList": [{
											"text": "",
											"enable": true,
											"status": 1
										}],
										"choiceEnable": false,
										"boardChosenReasons": [{
											"text": "日售759"
										}],
										"detailPagePic": "https://p0.meituan.net/mallimages/15a4747b13b580eedc493e33557fcd3a180927.jpg",
										"categoryId": 0,
										"baseCategoryId": 275
									},
									{
										"subscription": false,
										"subStatus": false,
										"skuId": 98320,
										"picUrl": "https://p0.meituan.net/mallimages/d4bfebff42d203e6ef8df97dc9c4c53e243115.jpg",
										"skuTitle": {
											"text": "丹东99红颜草莓250g"
										},
										"skuSubTitle": {
											"text": "嫩红水润，新鲜直达",
											"styleId": "lstv570"
										},
										"sellUnit": {
											"text": "份"
										},
										"sellPrice": {
											"text": "¥19.9"
										},
										"sellButton": {
											"text": "",
											"enable": true,
											"status": 1
										},
										"loose": false,
										"buyStep": "1",
										"buyUnit": "份",
										"process": false,
										"similar": false,
										"seqPrice": 1990,
										"dailySales": 722,
										"buttonList": [{
											"text": "",
											"enable": true,
											"status": 1
										}],
										"choiceEnable": false,
										"boardChosenReasons": [{
											"text": "日售722"
										}],
										"detailPagePic": "https://p0.meituan.net/mallimages/397491b1e99af7fabc7456a2dd14aaea249593.jpg",
										"categoryId": 0,
										"baseCategoryId": 283
									}
								],
								"tabName": {
									"text": "全部"
								},
								"tabId": -1
							}
						}
					},
					{
						"type": 1,
						"skuItem": {
							"subscription": false,
							"subStatus": false,
							"skuId": 95932,
							"picUrl": "https://p1.meituan.net/mallimages/3870ed965e4a4c81da66b09f7eeb247e432913.png",
							"skuTitle": {
								"text": "广西皇帝柑约500g"
							},
							"skuSubTitle": {
								"text": "天生小个头，浓缩的加倍甜蜜",
								"styleId": "lstv570"
							},
							"sellUnit": {
								"text": "份"
							},
							"sellPrice": {
								"text": "¥9.9"
							},
							"sellButton": {
								"text": "",
								"enable": true,
								"status": 1
							},
							"loose": false,
							"buyStep": "1",
							"buyUnit": "份",
							"process": false,
							"similar": false,
							"seqPrice": 990,
							"v2Tags": [{
								"tagType": 0,
								"type": 2,
								"priority": 10,
								"ordered": 15,
								"styleText": {
									"text": "买一赠一",
									"styleId": "tag_new_pro"
								}
							}],
							"memberPrice": {
								"text": "¥9"
							},
							"buttonList": [{
								"text": "",
								"enable": true,
								"status": 1
							}],
							"choiceEnable": false,
							"detailPagePic": "https://p1.meituan.net/mallimages/2f8ad396ae0c6a45e89466ee8c71343f133785.jpg",
							"categoryId": 0,
							"baseCategoryId": 275
						}
					},
					{
						"type": 1,
						"skuItem": {
							"subscription": false,
							"subStatus": false,
							"skuId": 99020,
							"picUrl": "https://p0.meituan.net/mallimages/2096c6ac90f45e925f7167fc95cfb86742720.jpg",
							"skuTitle": {
								"text": "广西砂糖桔500g起"
							},
							"skuSubTitle": {
								"text": "香甜多汁，味香馥郁",
								"styleId": "lstv570"
							},
							"sellUnit": {
								"text": "盒"
							},
							"sellPrice": {
								"text": "¥3.99"
							},
							"dashPrice": {
								"text": "¥7.9",
								"styleId": "dp"
							},
							"sellButton": {
								"text": "",
								"enable": true,
								"status": 1
							},
							"loose": false,
							"buyStep": "1",
							"buyUnit": "盒",
							"process": false,
							"similar": false,
							"seqPrice": 399,
							"v2Tags": [{
								"tagType": 1,
								"type": 2,
								"priority": 10,
								"ordered": 15,
								"image": {
									"title": "",
									"url": "https://p0.meituan.net/mallimages/ba73de9ddd06ac5c57406f846340538a7317.png",
									"width": 40,
									"height": 14,
									"imageId": ""
								}
							}],
							"recReason": {
								"recReasonId": "5_1_2",
								"recReasonText": {
									"text": "水果热卖榜第1名",
									"styleId": "rec_reason"
								}
							},
							"buttonList": [{
								"text": "",
								"enable": true,
								"status": 1
							}],
							"choiceEnable": false,
							"detailPagePic": "https://p0.meituan.net/mallimages/15a4747b13b580eedc493e33557fcd3a180927.jpg",
							"categoryId": 0,
							"baseCategoryId": 275
						}
					},

					{
						"type": 1,
						"skuItem": {
							"subscription": false,
							"subStatus": false,
							"skuId": 84157,
							"picUrl": "https://p0.meituan.net/mallimages/916076ba78d1f8ce38edda39dbfdf25478931.jpg",
							"skuTitle": {
								"text": "竹蔗茅根马蹄 400g"
							},
							"skuSubTitle": {
								"text": "煲汤、糖水，甜甜蜜蜜好味道",
								"styleId": "lstv570"
							},
							"sellUnit": {
								"text": "份"
							},
							"sellPrice": {
								"text": "¥7.9"
							},
							"dashPrice": {
								"text": "¥8.99",
								"styleId": "dp"
							},
							"sellButton": {
								"text": "",
								"enable": true,
								"status": 1
							},
							"loose": false,
							"buyStep": "1",
							"buyUnit": "份",
							"process": false,
							"similar": false,
							"seqPrice": 790,
							"v2Tags": [{
								"tagType": 1,
								"type": 2,
								"priority": 10,
								"ordered": 15,
								"image": {
									"title": "",
									"url": "https://p0.meituan.net/mallimages/ba73de9ddd06ac5c57406f846340538a7317.png",
									"width": 40,
									"height": 14,
									"imageId": ""
								}
							}],
							"recReason": {
								"recReasonId": "3",
								"recReasonText": {
									"text": "附近2762人看过",
									"styleId": "rec_reason"
								}
							},
							"buttonList": [{
								"text": "",
								"enable": true,
								"status": 1
							}],
							"choiceEnable": false,
							"detailPagePic": "https://p0.meituan.net/mallimages/ab4d80a4df0b3074d3f6bff7001dfb4c60034.jpg",
							"categoryId": 0,
							"baseCategoryId": 185
						}
					},
					{
						"type": 1,
						"skuItem": {
							"subscription": false,
							"subStatus": false,
							"skuId": 93884,
							"picUrl": "https://p1.meituan.net/mallimages/f9d4e9fd6e59a028f95461fcac070926829853.png",
							"skuTitle": {
								"text": "金针菇100g"
							},
							"skuSubTitle": {
								"text": "菇柄脆嫩，菇盖爽滑，烹煮皆可",
								"styleId": "lstv570"
							},
							"sellUnit": {
								"text": "份"
							},
							"sellPrice": {
								"text": "¥0.99"
							},
							"sellButton": {
								"text": "",
								"enable": true,
								"status": 1
							},
							"loose": false,
							"buyStep": "1",
							"buyUnit": "份",
							"process": false,
							"similar": false,
							"seqPrice": 99,
							"buttonList": [{
								"text": "",
								"enable": true,
								"status": 1
							}],
							"choiceEnable": false,
							"detailPagePic": "https://p0.meituan.net/mallimages/c12c349855b056dcde10523e000c1a8b246256.jpg",
							"categoryId": 0,
							"baseCategoryId": 238
						}
					},
					{
						"type": 1,
						"skuItem": {
							"subscription": false,
							"subStatus": false,
							"skuId": 95074,
							"picUrl": "https://p1.meituan.net/mallimages/c0f34d20d22862f1f8eb86f5065b5b78124431.jpg",
							"skuTitle": {
								"text": "爆汁番茄约500g"
							},
							"skuSubTitle": {
								"text": "红扑扑的脸蛋，讨人欢喜",
								"styleId": "lstv570"
							},
							"sellUnit": {
								"text": "份"
							},
							"sellPrice": {
								"text": "¥4.39"
							},
							"dashPrice": {
								"text": "¥5.29",
								"styleId": "dp"
							},
							"sellButton": {
								"text": "",
								"enable": true,
								"status": 1
							},
							"loose": false,
							"buyStep": "1",
							"buyUnit": "份",
							"process": false,
							"similar": false,
							"seqPrice": 439,
							"v2Tags": [{
								"tagType": 1,
								"type": 2,
								"priority": 10,
								"ordered": 15,
								"image": {
									"title": "",
									"url": "https://p0.meituan.net/mallimages/ba73de9ddd06ac5c57406f846340538a7317.png",
									"width": 40,
									"height": 14,
									"imageId": ""
								}
							}],
							"recReason": {
								"recReasonId": "5_1_1",
								"recReasonText": {
									"text": "蔬菜热卖榜第1名",
									"styleId": "rec_reason"
								}
							},
							"buttonList": [{
								"text": "",
								"enable": true,
								"status": 1
							}],
							"choiceEnable": false,
							"detailPagePic": "https://p0.meituan.net/mallimages/ee3805fbed3f8602938803630209c1bb208610.jpg",
							"categoryId": 0,
							"baseCategoryId": 226
						}
					},
					{
					        "type": 1,
					        "skuItem": {
					          "subscription": false,
					          "subStatus": false,
					          "skuId": 84803,
					          "picUrl": "https://p0.meituan.net/mallimages/7bcab476d3dc4322338c2b791201f4ba651284.png",
					          "skuTitle": {
					            "text": "泰丰散养老母鸡(斩件)500g"
					          },
					          "skuSubTitle": {
					            "text": "肉质紧实，汤鲜味美，营养滋补，适合煲汤",
					            "styleId": "lstv570"
					          },
					          "sellUnit": {
					            "text": "盒"
					          },
					          "sellPrice": {
					            "text": "¥22.9"
					          },
					          "sellButton": {
					            "text": "",
					            "enable": true,
					            "status": 1
					          },
					          "loose": false,
					          "buyStep": "1",
					          "buyUnit": "盒",
					          "process": false,
					          "similar": false,
					          "seqPrice": 2290,
					          "v2Tags": [
					            {
					              "tagType": 2,
					              "type": 9,
					              "priority": 45,
					              "ordered": 35,
					              "image": {
					                "title": "",
					                "url": "https://p0.meituan.net/mallimages/3573662e6d06853d8c9e889b4cdd62aa5402.png",
					                "width": 30,
					                "height": 16,
					                "imageId": ""
					              },
					              "styleText": {
					                "text": "冷鲜",
					                "styleId": "tag_temperature"
					              }
					            }
					          ],
					          "memberPrice": {
					            "text": "¥21.1"
					          },
					          "buttonList": [
					            {
					              "text": "",
					              "enable": true,
					              "status": 1
					            }
					          ],
					          "choiceEnable": false,
					          "detailPagePic": "https://p0.meituan.net/mallimages/57d5e2f9430aa7db1d79ebac5f18da04383484.jpg",
					          "categoryId": 0,
					          "baseCategoryId": 138
					        }
					      },
					      {
					        "type": 4,
					        "cboardVO": {
					          "boardType": 2,
					          "cboardNamePic": {
					            "title": "",
					            "url": "https://p1.meituan.net/mallimages/980869d165c28e998fefef0ad8a4beeb6383.png",
					            "width": 240,
					            "height": 75
					          },
					          "cboardBackGroundPic": {
					            "title": "",
					            "url": "https://p1.meituan.net/mallimages/0f14ec0437fe4cea2c87398d5b37bdd536607.png",
					            "width": 344,
					            "height": 500
					          },
					          "cboardDesc": {
					            "text": "实现菜场自由"
					          },
					          "cboardName": {
					            "text": "特惠榜"
					          },
					          "cboardTabVO": {
					            "skuItems": [
					              {
					                "subscription": false,
					                "subStatus": false,
					                "skuId": 93884,
					                "picUrl": "https://p1.meituan.net/mallimages/f9d4e9fd6e59a028f95461fcac070926829853.png",
					                "skuTitle": {
					                  "text": "金针菇100g"
					                },
					                "skuSubTitle": {
					                  "text": "菇柄脆嫩，菇盖爽滑，烹煮皆可",
					                  "styleId": "lstv570"
					                },
					                "sellUnit": {
					                  "text": "份"
					                },
					                "sellPrice": {
					                  "text": "¥0.98"
					                },
					                "dashPrice": {
					                  "text": "¥0.99",
					                  "styleId": "dp"
					                },
					                "sellButton": {
					                  "text": "",
					                  "enable": true,
					                  "status": 1
					                },
					                "loose": false,
					                "buyStep": "1",
					                "buyUnit": "份",
					                "process": false,
					                "similar": false,
					                "seqPrice": 98,
					                "v2Tags": [
					                  {
					                    "tagType": 1,
					                    "type": 2,
					                    "priority": 10,
					                    "ordered": 15,
					                    "image": {
					                      "title": "",
					                      "url": "https://p0.meituan.net/mallimages/ba73de9ddd06ac5c57406f846340538a7317.png",
					                      "width": 40,
					                      "height": 14,
					                      "imageId": ""
					                    }
					                  }
					                ],
					                "buttonList": [
					                  {
					                    "text": "",
					                    "enable": true,
					                    "status": 1
					                  }
					                ],
					                "choiceEnable": false,
					                "boardChosenReasons": [
					                  {
					                    "text": "¥0.99",
					                    "styleId": "dp"
					                  }
					                ],
					                "detailPagePic": "https://p0.meituan.net/mallimages/c12c349855b056dcde10523e000c1a8b246256.jpg",
					                "categoryId": 0,
					                "baseCategoryId": 238
					              },
					              {
					                "subscription": false,
					                "subStatus": false,
					                "skuId": 95556,
					                "picUrl": "https://p0.meituan.net/mallimages/603615e1321d3bcfb97963c7b9df1359245144.png",
					                "skuTitle": {
					                  "text": "统一太魔性柠檬红茶250ml"
					                },
					                "skuSubTitle": {
					                  "text": "双重柠檬风味",
					                  "styleId": "lstv570"
					                },
					                "sellUnit": {
					                  "text": "盒"
					                },
					                "sellPrice": {
					                  "text": "¥1"
					                },
					                "dashPrice": {
					                  "text": "¥1.8",
					                  "styleId": "dp"
					                },
					                "sellButton": {
					                  "text": "",
					                  "enable": true,
					                  "status": 1
					                },
					                "loose": false,
					                "buyStep": "1",
					                "buyUnit": "盒",
					                "process": false,
					                "similar": false,
					                "seqPrice": 100,
					                "v2Tags": [
					                  {
					                    "tagType": 1,
					                    "type": 2,
					                    "priority": 10,
					                    "ordered": 15,
					                    "image": {
					                      "title": "",
					                      "url": "https://p0.meituan.net/mallimages/ba73de9ddd06ac5c57406f846340538a7317.png",
					                      "width": 40,
					                      "height": 14,
					                      "imageId": ""
					                    }
					                  },
					                  {
					                    "tagType": 0,
					                    "type": 14,
					                    "priority": 25,
					                    "ordered": 65,
					                    "styleText": {
					                      "text": "4件起购",
					                      "styleId": "tag_delivery"
					                    }
					                  }
					                ],
					                "buttonList": [
					                  {
					                    "text": "",
					                    "enable": true,
					                    "status": 1
					                  }
					                ],
					                "choiceEnable": true,
					                "boardChosenReasons": [
					                  {
					                    "text": "¥1.8",
					                    "styleId": "dp"
					                  }
					                ],
					                "detailPagePic": "https://p0.meituan.net/mallimages/3983d5c9d721d66fc7eedbf942fd11ad385919.jpg",
					                "categoryId": 0,
					                "baseCategoryId": 306
					              },
					              {
					                "subscription": false,
					                "subStatus": false,
					                "skuId": 96292,
					                "picUrl": "https://p0.meituan.net/mallimages/7180a8551409394d747ef58557ec7ccf433817.png",
					                "skuTitle": {
					                  "text": "象大厨香辣味海带结30g"
					                },
					                "skuSubTitle": {
					                  "text": "迷你随身包：香辣爽口，脆滑美味",
					                  "styleId": "lstv570"
					                },
					                "sellUnit": {
					                  "text": "袋"
					                },
					                "sellPrice": {
					                  "text": "¥1.5"
					                },
					                "dashPrice": {
					                  "text": "¥2.8",
					                  "styleId": "dp"
					                },
					                "sellButton": {
					                  "text": "",
					                  "enable": true,
					                  "status": 1
					                },
					                "loose": false,
					                "buyStep": "1",
					                "buyUnit": "袋",
					                "process": false,
					                "similar": false,
					                "seqPrice": 150,
					                "v2Tags": [
					                  {
					                    "tagType": 1,
					                    "type": 2,
					                    "priority": 10,
					                    "ordered": 15,
					                    "image": {
					                      "title": "",
					                      "url": "https://p0.meituan.net/mallimages/ba73de9ddd06ac5c57406f846340538a7317.png",
					                      "width": 40,
					                      "height": 14,
					                      "imageId": ""
					                    }
					                  },
					                  {
					                    "tagType": 1,
					                    "type": 4,
					                    "priority": 0,
					                    "ordered": 1,
					                    "image": {
					                      "url": "https://p0.meituan.net/mallimages/f90ad4e725bfaec40ca0a93a5a8d672e6372.png",
					                      "width": 120,
					                      "height": 120
					                    }
					                  }
					                ],
					                "buttonList": [
					                  {
					                    "text": "",
					                    "enable": true,
					                    "status": 1
					                  }
					                ],
					                "choiceEnable": true,
					                "boardChosenReasons": [
					                  {
					                    "text": "¥2.8",
					                    "styleId": "dp"
					                  }
					                ],
					                "detailPagePic": "https://p1.meituan.net/mallimages/5e4085318c61156167aecb859b0909a9203256.jpg",
					                "categoryId": 0,
					                "baseCategoryId": 1020
					              }
					            ],
					            "tabName": {
					              "text": "全部"
					            },
					            "tabId": -1
					          }
					        }
					      },
					      {
					        "type": 1,
					        "skuItem": {
					          "subscription": false,
					          "subStatus": false,
					          "skuId": 4353,
					          "picUrl": "https://p0.meituan.net/mallimages/e0960cb77a9366060bdbfb888b8b8dd6358316.png",
					          "skuTitle": {
					            "text": "蒙牛风味酸牛奶圆周杯原味100g*8（新老包装随机发货）"
					          },
					          "skuSubTitle": {
					            "text": "天然发酵，营养健康，每一口都奶香浓郁",
					            "styleId": "lstv570"
					          },
					          "sellUnit": {
					            "text": "组"
					          },
					          "sellPrice": {
					            "text": "¥8.9"
					          },
					          "dashPrice": {
					            "text": "¥9.9",
					            "styleId": "dp"
					          },
					          "sellButton": {
					            "text": "",
					            "enable": true,
					            "status": 1
					          },
					          "loose": false,
					          "buyStep": "1",
					          "buyUnit": "组",
					          "process": false,
					          "similar": false,
					          "seqPrice": 890,
					          "v2Tags": [
					            {
					              "tagType": 1,
					              "type": 2,
					              "priority": 10,
					              "ordered": 15,
					              "image": {
					                "title": "",
					                "url": "https://p0.meituan.net/mallimages/ba73de9ddd06ac5c57406f846340538a7317.png",
					                "width": 40,
					                "height": 14,
					                "imageId": ""
					              }
					            },
					            {
					              "tagType": 2,
					              "type": 9,
					              "priority": 45,
					              "ordered": 35,
					              "image": {
					                "title": "",
					                "url": "https://p1.meituan.net/mallimages/13cb54c9315ede3cb9f4223e95cc99565554.png",
					                "width": 30,
					                "height": 16,
					                "imageId": ""
					              },
					              "styleText": {
					                "text": "冷藏",
					                "styleId": "tag_temperature"
					              }
					            }
					          ],
					          "buttonList": [
					            {
					              "text": "",
					              "enable": true,
					              "status": 1
					            }
					          ],
					          "choiceEnable": false,
					          "detailPagePic": "https://p0.meituan.net/mallimages/a92328c3af839f1a432a22d03f8b635493820.jpg",
					          "categoryId": 0,
					          "baseCategoryId": 411
					        }
					      },
					      {
					        "type": 1,
					        "skuItem": {
					          "subscription": false,
					          "subStatus": false,
					          "skuId": 66861,
					          "picUrl": "https://p0.meituan.net/mallimages/ff0152d0f83f3bc7878b9a463136bbe7215212.jpg",
					          "skuTitle": {
					            "text": "鲜板栗仁 200g"
					          },
					          "skuSubTitle": {
					            "text": "免去手剥，营养丰富，煲汤味更佳。",
					            "styleId": "lstv570"
					          },
					          "sellUnit": {
					            "text": "袋"
					          },
					          "sellPrice": {
					            "text": "¥8.99"
					          },
					          "sellButton": {
					            "text": "",
					            "enable": true,
					            "status": 1
					          },
					          "loose": false,
					          "buyStep": "1",
					          "buyUnit": "袋",
					          "process": false,
					          "similar": false,
					          "seqPrice": 899,
					          "memberPrice": {
					            "text": "¥8.1"
					          },
					          "buttonList": [
					            {
					              "text": "",
					              "enable": true,
					              "status": 1
					            }
					          ],
					          "choiceEnable": false,
					          "detailPagePic": "https://p0.meituan.net/mallimages/aaa92bce14977f70ce7671c99c4b4305179999.jpg",
					          "categoryId": 0,
					          "baseCategoryId": 221
					        }
					      },
					      {
					        "type": 1,
					        "skuItem": {
					          "subscription": false,
					          "subStatus": false,
					          "skuId": 94266,
					          "picUrl": "https://p0.meituan.net/mallimages/d050c694069a925494d3152ac519489f711573.png",
					          "skuTitle": {
					            "text": "象大厨调理肥牛卷248g"
					          },
					          "skuSubTitle": {
					            "text": "香而不腻的真正美味",
					            "styleId": "lstv570"
					          },
					          "sellUnit": {
					            "text": "袋"
					          },
					          "sellPrice": {
					            "text": "¥19.8"
					          },
					          "sellButton": {
					            "text": "",
					            "enable": true,
					            "status": 1
					          },
					          "loose": false,
					          "buyStep": "1",
					          "buyUnit": "袋",
					          "process": false,
					          "similar": false,
					          "seqPrice": 1980,
					          "v2Tags": [
					            {
					              "tagType": 0,
					              "type": 2,
					              "priority": 10,
					              "ordered": 15,
					              "styleText": {
					                "text": "满赠",
					                "styleId": "tag_new_pro"
					              }
					            },
					            {
					              "tagType": 2,
					              "type": 8,
					              "priority": 40,
					              "ordered": 30,
					              "image": {
					                "title": "",
					                "url": "https://p1.meituan.net/mallimages/98f5d9ec720939d7f5539bf237638d2d6438.png",
					                "width": 41,
					                "height": 16,
					                "imageId": ""
					              },
					              "styleText": {
					                "text": "半成品",
					                "styleId": "tag_base_property"
					              }
					            },
					            {
					              "tagType": 2,
					              "type": 7,
					              "priority": 35,
					              "ordered": 25,
					              "image": {
					                "title": "",
					                "url": "https://p0.meituan.net/mallimages/6c17858c3ce19fe909ad4ad6c2c62b2112570.png",
					                "width": 48,
					                "height": 44,
					                "imageId": ""
					              },
					              "styleText": {
					                "text": "应季好货",
					                "styleId": "tag_base_property"
					              }
					            },
					            {
					              "tagType": 2,
					              "type": 9,
					              "priority": 45,
					              "ordered": 35,
					              "image": {
					                "title": "",
					                "url": "https://p0.meituan.net/mallimages/77eeb1ee3fe06e007f20fcbb5ba1a99b5565.png",
					                "width": 30,
					                "height": 16,
					                "imageId": ""
					              },
					              "styleText": {
					                "text": "冷冻",
					                "styleId": "tag_temperature"
					              }
					            },
					            {
					              "tagType": 1,
					              "type": 4,
					              "priority": 0,
					              "ordered": 1,
					              "image": {
					                "url": "https://p0.meituan.net/mallimages/f90ad4e725bfaec40ca0a93a5a8d672e6372.png",
					                "width": 120,
					                "height": 120
					              }
					            }
					          ],
					          "buttonList": [
					            {
					              "text": "",
					              "enable": true,
					              "status": 1
					            }
					          ],
					          "choiceEnable": true,
					          "detailPagePic": "https://p0.meituan.net/mallimages/ced8f07c31aa4743bb8e4f0b3c0b8e09101725.jpg",
					          "categoryId": 0,
					          "baseCategoryId": 999
					        }
					      },
					      {
					        "type": 1,
					        "skuItem": {
					          "subscription": false,
					          "subStatus": false,
					          "skuId": 83670,
					          "picUrl": "https://p0.meituan.net/mallimages/e883feee7617f3e07437f6943eef572d306564.jpg",
					          "skuTitle": {
					            "text": "土鸡蛋8枚 405g"
					          },
					          "skuSubTitle": {
					            "text": "厨房必备，新鲜鸡蛋。鲜蛋表面如有泥土灰斑，不影响鲜蛋品质哦",
					            "styleId": "lstv570"
					          },
					          "sellUnit": {
					            "text": "盒"
					          },
					          "sellPrice": {
					            "text": "¥7.9"
					          },
					          "sellButton": {
					            "text": "",
					            "enable": true,
					            "status": 1
					          },
					          "loose": false,
					          "buyStep": "1",
					          "buyUnit": "盒",
					          "process": false,
					          "similar": false,
					          "seqPrice": 790,
					          "recReason": {
					            "recReasonId": "5_1_3",
					            "recReasonText": {
					              "text": "肉蛋热卖榜第1名",
					              "styleId": "rec_reason"
					            }
					          },
					          "buttonList": [
					            {
					              "text": "",
					              "enable": true,
					              "status": 1
					            }
					          ],
					          "choiceEnable": false,
					          "detailPagePic": "https://p0.meituan.net/mallimages/91b2c4a25480afb829fd479319f0ce0d248262.jpg",
					          "categoryId": 0,
					          "baseCategoryId": 148
					        }
					      },
				],
			}
		},
		props:{
		
			propsList:{
				type:Array
			}
		},
		created() {
			// console.log(propsList)
			// if(this.propsList){
			// 	this.list = this.propsList
			// }
		},
		watch: {
		    propsList: function(newVal,oldVal){
		        this.list = newVal;  //newVal即是chartData
		    }
		 },
		methods: {
			jumpDetails(e) {
				console.log(e.skuItem)
				
				setGoodsDetails(e.skuItem)
				
				uni.navigateTo({
					url: '/pages/views/goods/goodsDetails'
				});
			},
			addCart(e) {
				console.log(e)
				setGoodsDetails(e.skuItem)
				// 此处应该判断是否登录 如果没登录 跳转到登录页
				if(!getToken()){
						uni.navigateTo({ //登录
							url:'/pages/login/login'
						})
						return
				}
				var data = this.good_data
				data.status= 0;
				data.img =  e.skuItem.picUrl;
				data.title =  e.skuItem.skuTitle.text;
				data.money = parseFloat(e.skuItem.sellPrice.text.substr(1));
				
				data.imgList.push(e.skuItem.picUrl);
				data.imgList.push(e.skuItem.detailPagePic);
				data.xiaoliang = e.skuItem.skuId;
				data.goods_id = e.skuItem.skuId;
				
				
				
				if(data.skuArr){
					let sku = data.skuArr
				
					for(let i=0;i<sku.length;i++){
						sku[i].img = data.img
						sku[i].goods_sku_text = data.title+"测试规格"+i;
						sku[i].money = data.money 
						
					}

				}
				if(data.sku){
					let sku = data.sku[0].child
				
					for(let i=0;i<sku.length;i++){
						sku[i].imgs = data.img
						sku[i].tagname = data.title+"测试规格"+i;
						sku[i].money = data.money 
						
					}
				
				}
				data.selectSku.goods_sku_text = data.skuArr[0].goods_sku_text
				data.selectSku.img = data.skuArr[0].img
				data.selectSku.money = data.skuArr[0].money
				
				console.log(data)
				
				
				
				var colCart = getCart();
				if(colCart){
					for(let y = 0;y < colCart.length;y++){
						console.log(data.goods_id)
						console.log( colCart[y].goods_id)
						if(data.goods_id == colCart[y].goods_id){
							colCart[y].number++;
							// console.log(colCart) 
							resetCart(colCart)
						}else{
							console.log(y)
							if(y == colCart.length-1){
								setCart(data)
							}
							

						}
					}
				}else{
					setCart(data)
					
				}
				
				/**
				 * 模拟获取购物车的数量 getCart
				 */
				let cart = getCartNumber()
				uni.setTabBarBadge({
				  //给tabBar添加角标
				  index: 2,
				  text: String(cart)
				});
				
				
				
				// 存储商品数据
				uni.showToast({
				  title: '加入购物车成功 !',
				  icon: 'none'
				});
				
			},
		},
	}
</script>

<style scoped lang="scss">
	.good_skuSubTitle {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}


	.goodList {
		padding: 20rpx;
		column-count: 2;
		/*分为两列  用于瀑布流*/
		column-gap: 20rpx;

		background: #F8F8F8;
		overflow: hidden;
	}
	.tag1 {
		font-size: 20rpx;
		border: 1px solid #FF5560;
		color: #FF5560;
		border-radius: 15%;
		padding: 0 4rpx;
	}
	.cboardVO{
		height: 65vw;
		background-size: 100% 100%;
	}

	.cboardVO_tag{
		width: 50rpx;height: 50rpx;position: absolute;
		left: 0;top: 0;
	}
	
	
	
	
	
	

	.loading {
		height: 80upx;
		line-height: 80upx;
		text-align: center;
		color: #ccc;
		font-size: 24upx;
		width: 100%;
		margin-bottom: 20upx;
	}

	.goods {
		height: 100%;
		overflow: auto;
		margin-bottom: 20upx;
		break-inside: avoid;
		/*用于瀑布流*/
		border-radius: 10upx;
		box-sizing: content-box;

		&:first-child {
			margin-top: 0;
		}
	}

	.goods .top {
	    width: 100%;
	    height: 0;
	    padding-bottom: 100%;
	    position: relative;
		overflow: hidden;
		background-color: #ffffff;
	}

	.top .cover {
		width: 100%;
		 height: 100%;
		position: absolute;
		display: flex;
		align-items: center;
	}

	.top .tags {
		width: 65upx;
		height: 65upx;
		position: absolute;
		top: 0;
		left: 0;
	}

	.bottom {
		background-color: #ffffff;
		overflow: hidden;
	}

	.goods_name {
		/* height: 66upx; */
		word-break: break-all;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		font-weight: bold;
		line-height: 48rpx;
	}


	.bottom .price .text1 {
		font-size: 36upx;
		font-weight: bold;
		color: $mycolor;
	}

	.bottom .price .text2 {
		font-size: 22upx;
		color: #a0a0a0;
		text-decoration: line-through;
		padding-left: 15upx;
	}

	.g_left {
		font-size: 24upx;
		align-items: center;
	}

	.g_left text {
		display: inline-block;
		height: 35upx;
		line-height: 35upx;
		border-radius: 10upx;
		color: $mycolor;
	}

	.g_right {
		font-size: 28upx;
		color: $mycolor;
	}
</style>
